<div class="panel form-horizontal" style="">
<div class="page-header">
<h4 class="ng-binding">缴纳保证金</h4>
</div>
<div class="panel-body" style="">
	<div class='alert alert-success alert-dismissable'>
			<div class='fui-according'>
				<div class='fui-according-header' style="color: #666;line-height:1.2rem;padding-left:0.6rem">
					<div class="text" style="font-size:0.65rem;color:#666;line-height:1.2rem;padding-left:1rem">
						需缴纳 <span class='text-danger'>{{pagedata.item.yajinfee}}</span> 元，才可 <span class='text-danger'>开小店！</span>
					</div>
				</div>
			</div>
	</div>
	<div class='form-group'>
			<label class='col-xs-12 col-sm-3 col-md-2 right-label'>缴纳余额</label>
			<div class='col-xs-12 col-sm-8 col-lg-9'><span style="font-size:20px;font-weight:bold">￥{{pagedata.item.yajinfee}}</span></div>
	</div>
	<div class="modal-sub">
	<button ng-if="!pagedata.order_id" class="btn btn-primary" ng-click="pagedata.recharge()">确认缴纳</button>
	<button ng-if="pagedata.order_id" class="btn btn-primary" ng-click="access_json('jy_chengedu/manage.yajin_log/list/')">查看订单</button>
	</div>
</div>
</div>
<script>
scope.pagedata.recharge=function(){
	scope.post_json('post',scope.pagedata.item,function(res){
		console.log('pay_id');console.log(res);
		scope.pagedata.order_id=res.order_id
		scope.$evalAsync();
		require(['tool'],function(tool){
			tool.pay(res.pay_id,function(res){
				console.log('收到支付结果！');
				if(res.type=='success'){
					scope.message('缴纳成功！','','goback');
				}else{
					scope.message('缴纳失败！'+res.message,'','goback');
				}
			});
		});
	});
}
</script>